<?php

$query = "SELECT
                asText(diagioitinh.DiaGioi) AS polygon,
                tinh_thanhpho.Dan_So
                FROM
                tinh_thanhpho
                INNER JOIN diagioitinh ON CONVERT(SUBSTRING_INDEX(diagioitinh.IdTinh,'.',1), UNSIGNED INTEGER) = tinh_thanhpho.Id";
$rs = mysql_query($query);

$query = "SELECT
                Sum(tinh_thanhpho.Dan_So) AS tongso,
                tinh_thanhpho.Ten,
                tinh_thanhpho.Lat,
                tinh_thanhpho.Lng
                FROM
                tinh_thanhpho
                GROUP BY tinh_thanhpho.Id";
$rs_tongso = mysql_query($query);





